package net.wwang.open.global;

/**
 * 全局返回状态
 *
 * @author WangWei
 * @date 2020/8/12
 */
public enum ResponseState {
	/**
	 * HTPP状态码
	 */
	SUCCESS(true, 200, "OK"),
	CREATED(true, 201, "Created"),
	FAILED(false, 400, " Bad Request"),
	UN_AUTHORIZED(false, 401, "Unauthorized"),
	FORBIDDEN(false, 403, "Forbidden");

	ResponseState(boolean success, int code, String message) {
		this.success = success;
		this.code = code;
		this.message = message;
	}

	private int code;
	private String message;
	private boolean success;

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

}
